using System;
using System.Drawing;
using Motorway_Simulator.GUI.Designer;


namespace Motorway_Simulator.Components
{
    /// <summary>
    /// Van object
    /// </summary>
    [Serializable]
    public class Van : Vehicle
    {
        /// <summary>
        /// Length of the vehicle
        /// </summary>
        private const int length = 30;

        /// <summary>
        /// Holds the image of the vehicle
        /// </summary>
        private Bitmap image = Motorway_Simulator.Properties.Resources.van;

        /// <summary>
        /// Holds the width
        /// </summary>
        private const int width = 20;
        /// <summary>
        /// Initializes a new instance of the <see cref="Van"/> class.
        /// </summary>
        /// <param name="entranceNode">The entrance node.</param>
        /// <param name="driverStyle">The driver style.</param>
        public Van(Point startPoint, RoadUnit currentRoadUnit)
            : base(startPoint,length, currentRoadUnit)
        {
            this.maxAcclerationRate = 4;
            this.imageHeight = width;
            this.imageWidth = length;
            image = RotateImageClockWise(image);
            

        }

        /// <summary>
        /// Draws the image
        /// </summary>
        /// <param name="g">Grahics</param>
        public override void Draw(Graphics g)
        {
            Console.WriteLine(" drawing image " + this.CurrentPoint.X + " " + (this.CurrentPoint.Y + (DesignCanvas.squareUnit / 2) - (length / 2f)));
            g.DrawImage(image, this.CurrentPoint.X, this.CurrentPoint.Y + (DesignCanvas.squareUnit / 2) - (length / 2f),imageWidth ,imageHeight);
        }

    }
}